import { AxiosRequestConfig, AxiosResponse } from 'axios';

type TCommonFn<T> = (arg: T) => T;

export interface IMyRequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  /**
   * 添加自定义请求过滤
   */
  interceptors?: {
    request?: TCommonFn<AxiosRequestConfig>;
    requestError?: TCommonFn<any>;
    response?: TCommonFn<T>;
    responseError?: TCommonFn<any>;
  };
  /**
   * 是否添加全局过滤器
   */
  needGlobalInterceptors?: boolean;
}
